Functional Near-Infrared Spectroscopy for the Classification of Motor-Related Brain Activity on the Sensor-Level

Sensor-level human brain activity is studied during real and imaginary motor execution using functional near-infrared spectroscopy (fNIRS). Blood oxygenation and deoxygenation spatial dynamics exhibit pronounced hemispheric lateralization when performing motor tasks with the left and right hands. This fact allowed us to reveal biomarkers of hemodynamical response of the motor cortex on the motor execution, and use them for designing a sensing method for classification of the type of movement. The recognition accuracy of real movements is close to 100%, while the classification accuracy of imaginary movements is lower but quite high (at the level of 90%). The advantage of the proposed method is its ability to classify real and imaginary movements with sufficiently high efficiency without the need for recalculating parameters. The proposed system can serve as a sensor of motor activity to be used for neurorehabilitation after severe brain injuries, including traumas and strokes.


Introduction
A study of neurophysiological brain activity attracts significant interest of researchers from various fields of science due to its interdisciplinary nature. The considerable progress in the development of experimental approaches for neuroimaging and mathematical methods for big data analysis provides great opportunities for vast and detailed studies of specific phenomena in the brain neural network and the creation of sensor systems for monitoring brain states. Recent progress in this field has been achieved at the junction of mathematics, physics, engineering and neuroscience [1]. This is confirmed by an increasing number of papers related to brain research and published in multidisciplinary journals (see, e.g., [2][3][4][5]).
From the viewpoint of nonlinear dynamics, brain is a very complex dynamical system, containing around 86 billion neurons [6]. The neurons are connected by synapses, thus forming a complex network with nodes and links represented respectively by neurons and synapses. Specific features of time-spatial activity of the neural network in the brain cortex and cooperative dynamics of techniques in studying neural activity in the primary motor cortex M1 because this area lies on the outer cortices which is within the blood oxygenation level deprivation (BOLD) scanning range for fNIRS [43]. A significant advantage of fNIRS over MEG is its portability and more easy mounting of sensors on the patient's head. Moreover, the fNIRS equipment is cheaper as compared to fMRI and MEG. Thus, fNIRS holds a special place among modern methods of neuroimaging due to a good combination of temporal and spatial resolutions, overall mobility and simplicity of use.
In this paper, we analyse fNIRS data acquired during human real and imaginary motor activity associated with motor cortex hemodynamics. In particular, we extract specific features of the fNIRS signals related to different types of motor activity, which can be used in BCIs. We also propose an universal method to classify fNIRS trials obtained during motor imagery and develop a sensor of motor activity to be used for neurorehabilitation systems after various brain injuries, including stroke.

Participants
Twelve healthy volunteers (age: 22-38 years, gender: 7 men and 5 women), right-handed, amateur practitioners of physical exercises, non-smokers participated in the experiment. None of the subjects had diagnosed diseases of the musculoskeletal system and neurological diseases and did not take medications. Every participant was asked to maintain a healthy lifestyle with 8-hours night rest for 48 h before starting the experiment.
Each participant provided informed written consent before participating in the experiment. The experimental procedure was performed in accordance with the Helsinki's Declaration and approved by the local Ethics Committee of the Innopolis University.

Experimental Equipment
The experiment was designed to record a hemodynamic neuronal response in the motor cortex using fNIRS which records fast changes in the brain activity. The fNIRS signals were acquired by the NIRScout device manufactured by the NIRx Company (Germany). The NIRScout system has a 7.8125-Hz resolution and contains 8 sources and 8 detectors placed on the subject's scalp in the primary motor cortex area (M1) as shown in Figure 1a. Each pair "source-detector" was placed close enough to each other (about 3 cm) to form a fNIRS channel. In our experiments we used 20 fNIRS channels and 9 EEG electrodes located according to the international scheme "10-10" scheme [44], as illustrated in Figure 1b. (a) Location of fNIRS sources (marked with red) and detectors (marked with blue) on the subject's head in the area of primary motor cortex (shaded area). (b) Location of 20 fNIRS channels (grey circles with channel numbers) across motor cortex (shaded area) and 9 EEG electrodes (CP4, CPz, CP3, C4, Cz, C3, FC4, FCz, FC3) according to "10-10" scheme (black circles with channel names). (c) Schematic illustration of traveling path of near-infrared light from source (S) to neighbour detectors (D 1 and D 2 ) through brain cortex matter.
All experiments were carried out in the Neuroscience and Cognitive Technology Lab of the Innopolis University.

Experimental Procedure
The experiment was performed as follows. The subjects were sitting on a comfortable chair while performing motor actions or motor imaginary of left and right hands according to the corresponding text command on a computer monitor placed in front of the subject's eyes at a distance of 70-80 cm.
The experimental design is schematically shown in Figure 2. Each experiment began and ended with a 3-min recording of background brain activity, during which the subject were instructed to relax and make no hand movements. The experiment included two sessions (Figure 2a). In the first session, the subject was asked to perform real movements with left or right hand according to the corresponding command on the screen. Then, after a short break, in the second session the subject was asked to imagine the same type of movement according to the corresponding command on the screen. Each fNIRS trial during every session consisted of the text command presentation indicating the type of motor activity (the subject was given 15 s to perform required movement) and the rest interval (15 s from the end of motor activity till the next command). There were 10 trials for each type of motor activity.  Hand movement consisted of repeated bending/unbending of fingers to the center of the palm (similar to clenching of imaginary ball), as illustrated in (Figure 2b). The repeated movements were performed at the pace comfortable for the subject.

Data Acquisition and Pre-Processing
In the fNIRS experiments, we used a laser light with two wavelengths, λ 1 = 785 nm and λ 2 = 850 nm, that can pass through skin, bone and water, but are highly absorbed by oxyhemoglobin and deoxyhemoglobin, respectively [45]. In the developed configuration for the fNIRS recording, the light sources and detectors were placed on the scalp and dual-wavelength light was transmitted through skin, skull, and top layer of the cerebral cortex.
As seen from Figure 1c, near-infrared light travels from the source to the detector through a specific path. First, it goes from the source to the tissue and at the depth of approximately 3 cm is reflected towards the detector. The path shape limits the distance between the source and detector to 2-3 cm and allows one to detect changes in the reflected near-infrared light.
In order to obtain information about changes in oxygenation of the tissue, we analyzed raw fNIRS data using special software. Since oxyhemoglobin and deoxyhemoglobin have different light absorption properties, we calculated changes in the reflected dual-wavelength light using the modified Beer-Lambert law [46]. For this purpose, we introduced a new characteristic measure (H) which reflects relative changes in oxyhemoglobin and deoxyhemoglobin.
The fNIRS data acquisition and pre-processing procedure were performed with software NIRScout. It is well-known that experimental fNIRS data are often affected by side physiological noises and artifacts, whose characteristic frequencies are in the fNIRS frequency band, including Mayer wave (with a typical frequency close to 0.1 Hz), respiration (close to 0.25 Hz), and heartbeat (close to 1 Hz). As was mentioned in the review paper [47], in many cases the band-pass filtering is mostly sufficient for removing low-frequency physiological noise in fNIRS data. According to this observation, we also applied the 0.01-0.1 Hz band-pass filter to the fNIRS signals using NIRScout to prevent the effect of side physiological activities.
The NIRScout software was also used for presentation of stimuli (text commands) and for logging the events (such as beginning and end of motor activity) in the protocol file. According to this file, 35-s long trials were formed by 5-s preparation before the text command, 15-s motor activity, and 15-s rest interval as illustrated in Figure 2b. The 5-s interval at the beginning of each trial was used for baseline correction. Specifically, the distribution of HbO/HbR was averaged over these 5 s and the obtained value was subtracted from the corresponding trial.

Data Analysis
The characteristic value H i (i = 1, . . . , N f N IRS , where N f N IRS = 20 is the number of fNIRS channels) provides information about HbO/HbR dynamics obtained from corresponding fNIRS channels. At the same time, to compare significance of such dynamics across the channels we need to introduce new characteristic δH i,j that can be calculated as follows.
First, we calculate the value of H i T as H i averaged for each fNIRS channel, separately for HbO and HbR, across time interval T ∈ (5, 20) s corresponding to real or imaginary motor activity: In the previous papers [48,49], we have introduced the measure of connectivity based on the reconstruction of functional links between neuronal ensembles in different frequency bands by comparing spectral components of the EEG signals belonging to these bands. Here, we extend this approach to the time domain for analyzing the restoration of connectivity by similarity of hemodynamic responses in different areas of the motor cortex. This allows us to identify the cortical region in M1 with most similar activity for further classification of motor execution events.
According to our approach, we calculate matrices δH i,j of the difference between H T for all fNIRS channels i and j (i, j = 1, . . . , 20) for each type of motor activity (real and imaginary) for both HbO and HbR as Previous fMRI studies [50] indicate that the activation of primary motor cortex during real movement increases the level of oxyhemoglobin (H HbO ) and decreases deoxyhemoglobin (H HbR ). Therefore, in the resulting matrices dH i,j we leave only values dH i,j > 0 for HbO and dH i,j < 0 for HbR and take their absolute values for easier comparison. Finally, we construct the distributions N(dH i,j ) of dH i,j for each 20 × 20 matrix obtained for HBO and HbR in the case of left/right real and imaginary movements. These diagrams are present in Figure 3 for subject #3.
Based on the obtained distributions N(dH i,j ) we introduce cumulative distribution functions F dH i,j (h) = P(dH i,j ≤ h) which yield the probability for dH i,j to be smaller than h. The fourth quartile of the F(h) distribution is the value of h ≥ 0.75. The corresponding cumulative distributions are shown in Figure 3 by blue curves, while dashed vertical lines indicate the border of the fourth quartile. As a consequence, we only consider dH i,j values that fall into the fourth quartile of distributions (F(H i,j ) ≥ 0.75) because the resulting values of dH i,j are the most significant and thus can be used to find fNIRS channels suitable for the classifier (see Results). Thus, for further mathematical analysis we obtain the following matrixes of functional connectivity between different fNIRS channels corresponding to the dynamics of oxygenation and deoxygenation, respectively:

Algorithm for Classification of Brain Activity During Real and Imagery Motor Executions
Let us now consider the online algorithm based on the construction of a decision tree for binary classification of brain activity during real and imagery motor executions. The tree-like model of decisions was created as a result of empirical analysis of the experimental data. The proposed algorithm for processing fNIRS data is illustrated in Figure 4 in the form of a flowchat which contains the following main steps.
1. For each considered channel i and type of motor activity (right/left hand, execution/imagery) we subtract spatial oxyhemoglobin (HbO) (H i HbO ) and deoxyhemoglobin (HbR) (H i HbR ) distributions for the right hemisphere (H j R , fNIRS channels j of interest from right hemisphere) from the corresponding distribution for the left hemisphere (H i L , symmetrical channels i from left hemisphere). Similar to our approach (2) which uses average values, we calculate differences for individual symmetrical channels in the left and right hemispheres as 2. Then, we average ∆H i HbO and ∆H i HbOR over the time interval corresponding to motor activity T ∈ (5, 20) s to find ∆H i HbO T and ∆H i HbO T as 3. For each separate fNIRS signal trial, we calculate characteristics C R and C L taking into account the following criteria for each considered symmetric fNIRS channels in the left and right hemispheres.
(i) If ∆H i HbO T > 0 and ∆H i HbR T < 0 is true for one of the channels i, then C R := C R + 1 (value C R takes discrete values, minimal value is C R = 0 and peak value is equal to the number of considered fNIRS channels of interest in one of the hemispheres). (ii) If ∆H i HbO T < 0 and ∆H i HbR T > 0 is true for one of the channels i, then C L := C L + 1 (value C R takes discrete values, minimal value is C L = 0 and peak value is the same as peak value of C R ).
4. Finally, we make a decision according to the following criteria.
(i) If C R > C L , then right-hand (real or imaginary) motor activity takes place.

Estimation of Classification Accuracy of Brain Activity During Motor Execution and Motor Imagery
In order to generalize the results of statistical analysis to an independent data set, we applied the classical k-fold cross-validation technique [51] with k = 10 and 20 fNIRS trials to every subsample. Additionally, the accuracy of the proposed detection method was evaluated by computing a percentage of true positive and false positive, true and false negative detections, sensitivity and specificity [52,53] using a 20-min experimental session, during which (i) the commands described in Section 2.3 (to perform real/imaginary movement with left/right hand) were issued to the subject and (ii) the classification algorithm recognised the type of movement using only 6 fNIRS channels. The true positive (TP) was computed as a percentage of correctly classified trials of right hand, and true negatives (TN) correctly classified trials of left hand. The false positive/negative (FP/FN) represents a percentage of incorrect automatically detected motor actions (FP being the trials classified as right-hand motor activity, but actually performed as left-hand motor activity, while FN denotes the opposite situation).
The true positive fraction (TPF) or sensitivity, true negative fraction (TNF) or specificity, and false positive fraction (FPF) of the method were assessed as [54] 3. Results Figure 5 displays the results of the analysis of complex spatial brain activity in the primary motor cortex M1 detected by fNIRS. In Figure 5a,b we plot spatial distributions of oxyhemoglobin and deoxyhemoglobin, averaged over 10 trials of right-hand motor execution and right-hand motor imagery, respectively. The results for all 20 fNIRS channels are presented as mean values with a standard error.

Spatial Brain Activity During Motor Execution and Motor Imagery
In the case of motor execution, as seen from Figure 5a, several fNIRS channels demonstrate very specific dynamics; increasing oxyhemoglobin is accompanied by a corresponding decrease in deoxyhemoglobin during any motor activity, either real or imaginary (in time intervals between vertical dashed lines). We should note that this dynamics is much more pronounced in the left hemisphere (e.g., for channels 2, 3, 7, 8) for right hand and in the right hemisphere (for symmetric channels 12, 13, 17, 18) for left hand. Such a behavior, strongly linked to specific fNIRs channels, opens the opportunity to classify motor activity according to right and left hands.
It is worth noting that the above dynamics is less notable for motor imagery than for motor execution. As seen from Figure 5b, the oxyhemoglobin level slowly increases approximately 10 s after the beginning of movement imagination. The presence of the well-pronounced features of the hemodynamic response during motor imagery is very promissing for using fNIRS signals, to some degree, for detection of imaginary movements.
The most informative channels are those which display pronounced features of the hemodynamic response when performing both motor execution and motor imagery with left or right hand. The analysis of these channels is present in Figure 6 where we plot the matrices of functional connectivity (3) and (4) in the motor cortex for different types of motor activity (real/imaginary) related to right and left hands. First of all, one can clearly seen laterality between real and imaginary movements of left and right hands. When moving the right hand, the channels 2, 7 and 8 in the left hemisphere are most active exhibiting largest changes in the hemodynamic response. Whereas, when moving the right hand, the symmetric channels 12, 17 and 18 in the right hemisphere display the most pronounced activity. As a consequence, both an increase in oxygenation and a decrease in deoxygenation turn out to be informative in the mentioned channels, and its dynamics and connections with other channels are clearly seen in the connectivity matrices distributions. Secondly, the comparison of the brain response to real and imaginary movements allows us to conclude that motor execution yields a more accurate hemodynamic response. However, in the case of motor imagery, there is a strong connection with channel 2 in the left hemisphere for right hand, and channels 11 and 12 in the right hemisphere for left hand. At the same time, there is the activation (albeit less in amplitude as compared to real movements) of channels 7/8 and 17/18 for left/right hand, respectively. Since the particular areas of the motor cortex are responsible for different types of movement (real/imaginary), the fNIRS neuroimaging can be used for real-time diagnostics of motor activity.

Results of Real-Time Classification of Brain Activity
The main problem when creating any BCI based on motor imagery is a correct classification of single EEG/MEG trials. While averaged trials are usually exhibit a clearly pronounced difference between various types of movements (e.g., with left/right hand motor imagery), in the case of single trials, the classification problem is more drastic due to a high variability of EEG or MEG brain signals during imagination, as well as the existence of strong noise. Typically, the classification accuracy does not exceed 80% when special mathematical methods are applied, such as, e.g., SVM machines [55], wavelets [36,56], multilayer perceptrons [4], and recurrence quantitative measures [38].
The main advantage of fNIRS, as we demonstrated in the previous section, is a stable picture of spatial dynamics of oxygenation and deoxygenation in the M1 motor cortex during both real and imaginary movements. As seen from Figure 5, oxyhemoglobin and deoxyhemoglobin distributions exhibit qualitatively different dynamics on fNIRS channels in the left hemisphere and symmetric channels in the right hemisphere during 5-20 s intervals of right-hand motor execution/imagery. Considering the difference between hemoglobin dynamics in the left and right hemispheres, we can conclude that the oxyhemoglobin difference is mostly positive, while the deoxyhemoglobin difference is typically negative. In the case of left-hand motor activity, the opposite situation occurs, namely, the difference between signals from the left and right hemispheres is negative for oxyhemoglobin and positive for deoxyhemoglobin. It should be noted that these differences are manifested in the dynamics of i = {2, 7, 8} fNIRS channels in the left hemisphere and j = {12, 17, 18} symmetric channels in the right hemisphere.
This situation is illustrated in Figure 7, where plot the differences in temporal distributions of oxyhemoglobin and deoxyhemoglobin between left and right hemispheres for 10 trials recorded by fNIRS channels 2 and 12 for one subject. These results display the difference in the brain response between real and imaginary right-hand movements. The repeatability of the hemodynamic response in the motor cortex is clearly seen in Figure 7, when the same type of motor action is performed or imagined. One can also note the stability of the repeated maxima in the oxygenation difference between left and right hemispheres corresponding to real movement, whereas the maxima corresponding to motor imagery are unstable and varied over the trials. However, the tendency to increase the positive difference remains. Similar conclusions can be made when analyzing deoxygenation, but in this case the difference is negative. As a result, we can use these changes in oxygenation and deoxygenation dynamics in the left and right hemispheres as markers for classifying the type of movement and develop a method for online classification of right/left-hand motor activity based on fNIRS data. Finally, we implemented the classification algorithm described in Section 2.6 in our fNIRS-based experimental system for online classification of real and imaginary motor actions. We used the proposed classifier with six fNIRS channels i = {2, 7, 8} in the left hemisphere and j = {12, 17, 18} symmetric channels in the right hemisphere. Notably, in the majority of cases the type of motor action (both real and imagery) in all subjects was correctly identified by the data from only three fNIRS channels. Table 1 shows the results of automatic classification of left/right hand real and imaginary movements, as well as statistical analysis of true positive fraction, true negative fraction, and false positive fraction calculated with Equation (7).  Figure 8 shows the receiver operating characteristic (ROC) curves for right/left hand motor action, which displays the values of false positive fraction (FPF) versus true positive fraction (TPF). In the considered case, the ROC curves have two segments (0, 0) − (FPF, TPF) − (100, 100) (in %) because a binary classifier (in our case, the decision tree) can only take the values of either 0 or 1. The statistical analysis shows that the selectivity and specificity of the classifier are sufficiently high and reach 85%-100%. The areas under the ROC curves in Figure 8 indicate that the accuracy of the binary algorithm for motor execution is higher than for motor imagery. The number of incorrectly detected and uncertain events is about 5%-20%. This reflects the fact that real and imaginary motor actions by left and right hands are reliably recognized using eight sources and eight fNIRS detectors, followed by data processing of spatial brain activity with the simple online decision tree-based classifier.

Discussion
The classification of brain activity trials associated with motor imagery using different methods of neuroimaging is a modern research topic widely explored by many researchers from different fields of science [13,57,58]. The diverse literature indicates that different brain regions can be involved in motor imaginary [59], including primary motor cortex (M1) [60], supplementary motor area (SMA) [61], posterior parietal cortex (PPC) [62], prefrontal cortex [63], etc. Moreover, there are at least two types of motor imagination (kinesthetic and visual) characterised by the involvement of various areas of the brain cortex. In particular, a well-pronounced suppression of alpha activity was observed in the occipital region in subjects exhibiting the visual type of motor imagery. In contrast, kinesthetic subjects displayed a pronounced suppression of mu activity in the motor and somatosensory cortexes [16]. In the referenced paper, 65%-80% classification accuracy was reported when choosing optimal MEG channels for both kinesthetic and visual untrained subjects. Notably, such accuracy for untrained subjects is similar to classification accuracy obtained in EEG studies with trained subjects [64]. Based on the effect of suppressing mu/alpha and beta activity during motor imagery, it is possible to obtain up to 70%-85% accuracy using various classifiers, including machine learning methods, SVM, ICA, etc. [65]. The main obstacle for achieving higher classification accuracy of single trials is the significant variability of temporal-spatial brain activity during motor imagery, which does not allow revealing universal patterns associated with a particular type of motor imagination.
In addition, the use of the hemodynamic response for the classification of motor imagery (e.g., for neurorehabilitation) also imposes a number of limitations. Firstly, the hemodynamic response is quite inertial, so that the registration of mild changes in oxygenation and deoxygenation of blood is required in the area of interest. Secondly, due to a relatively high cost and a large size, the MRI equipment is usually used in clinics for diagnosis, but not for regular training of motor imagery to restore motor activity after a stroke, as in the case of using EEG. In this context, it is of considerable interest to use the fNIRS device as a sensor of brain activity with an appropriate classification algorithm for the allocation of motor-related brain activity on the sensor level. As we have shown, the hemodynamic response generated by motor activity is strong enough to distinguish the corresponding region of the motor cortex responsible for the motor pattern formation. Thanks to the hemodynamic analysis, which is not sensitive to EEG background activity, it is possible to increase classification accuracy due to better signal repeatability in the analysis of single events. As a result, the classification accuracy of imaginary activity was increased up to more than 90%, which is quite sufficient for medical practice in neurorehabilitation procedures. It is important to emphasize that the fNIRS-based sensor is able to classify not only the kinesthetic mode of imagination, which is characterized by a pattern similar to real movements but also the visual type of imagination. However, we have to assume that in some cases, the classifier cannot recognize motor activity (the "uncertanity" algorithm branch in Figure 4).
In conclusion, it should be noted that imaginary movements are often used to form control commands in active brain-computer interfaces (BCI) [66,67]. Typically, such systems are based on the registration of electric brain activity (EEG) due to the fact that EEG gives a very fast response to changes in cognitive states. Moreover, EEG sensors are cheap and portable and do not impede the subject movement. Although the proposed fNIRS-based sensor system is also portable that allows the installation of sources and detectors faster and more convenient than EEG (or the same in the case of dry EEG electrodes [68][69][70]), the fNIRS device is more expensive than EEG. At the same time, the number of needed fNIRS channels for classifying activity is not high that can reduce the system cost. On the other hand, due to slow hemodynamic response, fNIRS exhibits a relatively large delay in detecting brain activity as compared to EEG, which restrict its application in BCIs. Nevertheless, the proposed fNIRS classifier can be used as a motor imagery sensor in neurorehabilitation systems with patients for which a 10-15 s latency is not significant. However, if such a BCI is used in game interfaces [71,72] or control interfaces of external devices (wheelchair, manipulator, etc.) [73][74][75], such delay time is critical and negate the advantages of our system in classification accuracy of brain states. One of the possible solutions to this problem could be the use of hybrid fNIRS-EEG BCIs [76][77][78]. The consideration of this type of classifier is out of the scope of this paper and might be the matter of future research.

Conclusions
In this paper, we have carried out the analysis of fNIRS data acquired during real and imaginary movements. Distinct spatial dynamics in the motor cortex when performing motor actions (real or imaginary) with the left or right hand exhibits pronounced laterality between two hemispheres. This allowed us to reveal hemodynamic biomarkers for classification of the type of movement. The proposed fNIRS-based sensor provides close to 100% recognition accuracy in the detection of real movements, while the classification accuracy of motor imagery is a little smaller and reach 90%.
The important advantage of the proposed method is the possibility to efficiently classify different types of movement, both real and imaginary, without recalculation of the system parameters. This essential feature of the developed sensor results from pronounced laterality of the hemodynamic brain response to motor activity.
The knowledge of the hemodynamic behavior in the motor cortex during real and imaginary motor activity along with approaches for its detection can be helpful not only for fundamental studies on human motor-related tasks but also for the development of fNIRS-based BCIs. Funding: This research was funded by the Russian Science Foundation (17-72-30003) in the part of experimental study and development of classification algorithm, and President program for leading scientific school support (NSH-2594.2020.2) in the part of analysis of brain hemodynamic response during motor act.

Conflicts of Interest:
The authors declare no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results.